package com.itwill.ecom.ordersDetail;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping("/ordersDetail")
public class OrdersDetailController {
	@Autowired private OrdersDetailDao orderDetailDao;
	@Autowired private OrdersDetailService ordersDetailService;
	
	public OrdersDetailController() {
		
	}
	
	//추가??
	@RequestMapping(value="create")
	public String create(){
//	public String create(OrdersDetailBeans create){
		//ordersDetailService.createOrdersDetail(create);
		System.out.println("상세주문추가");
		return "ordersDetail/test/createTest";//이부분은 잘 모르겠습니다. 저한테 설명좀 해주세요 ㅠㅠ(연희)
	}
	
	
	//상세 전체 리스트 뽑기
	@RequestMapping(value="odetailList", method=RequestMethod.GET)
	public String allList(){
		//ordersDetailService.findAll();
		System.out.println("상세주문 리스트 다뽑을래염");
		return "ordersDetail/detail_list";
	}
	
	//주문번호에 해당하는 상세리스트 뽑기
	@RequestMapping(value="listOrders", method=RequestMethod.GET)
	public String ordersList(){
		//ordersDetailService.findDetail(ordersNo);
		System.out.println("해당 주문번호에 속하는 상세리스트 뽑아줭");
		return "ordersDetail/test/detailListTest";
	}
	
	//상세주문 하나만 뽑기
	@RequestMapping(value="odetailview", method=RequestMethod.GET)
	public String detailOne(){
		//ordersDetailService.findOne(detailNo);
		System.out.println("상세주문번호로 하나만 보여줘");
		return "ordersDetail/detail_detail";
	}
		
	//상세주문삭제
	@RequestMapping(value="delete", method=RequestMethod.GET)
	public String delete(){
		//ordersDetailService.delete(delete);
		System.out.println("상세주문 하나 지워야징~");
		return "ordersDetail/test/delete";
	}
	
	@RequestMapping(value="odetailListJSON", method=RequestMethod.GET)
	public String odetailJSON(){
		System.out.println(">>>>>>>>>>>상세주문 리스트 JSON요청");
		return "ordersDetail/detail_listJSON";
	}
	
	@RequestMapping(value="ordersDetailsJSON", method=RequestMethod.GET)
	public String odetailsJSON(){
		System.out.println(">>>>>>>>>>상세주문의 상세보기");
		return "ordersDetail/detail_detailJSON";
	}
}
